#include <gtest\gtest.h>
#include <info_model\objects\engine.h>
#include <info_model\info_model.h>

namespace info_model
{
	TEST(ut_info_model, add_remove_object)
	{
		boost::shared_ptr<engine_t> engine(new engine_t);
		info_model im;

		EXPECT_TRUE(im.add_object(engine));
		EXPECT_FALSE(im.add_object(engine));

		im.remove(object_type::OBJECT_ENGINE);
		EXPECT_TRUE(im.add_object(engine));
	}

	TEST(ut_info_model, find_object)
	{
		boost::shared_ptr<engine_t> engine(new engine_t);
		info_model im;

		EXPECT_TRUE(im.add_object(engine));

		EXPECT_TRUE(im.find(object_type::OBJECT_ENGINE).get() == engine.get());
	}
}